<?php
namespace app\pay\controller;
use think\Controller;
class Huidiao extends Controller
{
	public function index(){
        $post =input("post.");
        if(empty($post)){
            $post = $_POST;
        }
        if(empty($post)){
            $post = $_GET;
        }
		file_put_contents("logs/pay_notify.txt",var_export($post,true)."\n",FILE_APPEND);
	}
}

//回调结果
//        $post = [
//            "transcode" =>  "050",
//            "merchno" =>  "jn2019032514062",
//            //"dsorderid" =>  "P1905040659442018000078200",
//            //"dsorderid" =>  "P1905040659446273100072201",
//            //"dsorderid" =>  "P1905040659445576500072002",
//            "dsorderid" => "C1905050737139762000081904",
//            "sign" =>  "5ce48b2d1991b28ffc7417db447fd3c4",
//            "ordersn" =>  "19042904511297704042369",
//            "status" =>  "00",
//            "errtext" =>  "交易成功",
//            "orderid" => "2019042916483400100111650",
//            "merchantName" =>  "郑州乐驿旅馆有限公司",
//        ];

/*
 * 扣款返回结果
 * array(9) {
  ["transcode"] => string(3) "050"
  ["merchno"] => string(15) "jn2019032514062"
  ["dsorderid"] => string(24) "P19042903362302925042333"
  ["sign"] => string(32) "f105abe865cf1af103cdc64f763c5f27"
  ["ordersn"] => string(23) "19042903414732344042367"
  ["returncode"] => string(4) "0003"
  ["errtext"] => string(15) "交易处理中"
  ["orderid"] => string(25) "2019042915391000100117128"
  ["merchantName"] => string(33) "郑州喜之林旅馆有限公司"
}
 * */


/**
 * 扣款返回结果
 * array(7) {
["transcode"] => string(3) "050"
["merchno"] => string(15) "jn2019032514062"
["dsorderid"] => string(24) "P19042903362302925042333"
["sign"] => string(32) "b7297de144f8963274226b5306e8bc94"
["ordersn"] => string(23) "19042903430609648042380"
["returncode"] => string(4) "0007"
["errtext"] => string(39) "订单重复，请更换商户订单号"
}
 *
 *
 */




/**
 * 还款成功结果
 *
 * array(8) {
["transcode"] => string(3) "050"
["merchno"] => string(15) "jn2019032514062"
["dsorderid"] => string(23) "19042904111062506042325"
["sign"] => string(32) "d383361b9d70ff8e829b3bfe13d46aaa"
["ordersn"] => string(23) "19042904111023073042372"
["returncode"] => string(4) "0003"
["errtext"] => string(15) "交易处理中"
["orderid"] => string(25) "2019042916083300100102107"
}
 *
 *
 *
 * array(8) {
["transcode"] => string(3) "050"
["merchno"] => string(15) "jn2019032514062"
["dsorderid"] => string(23) "19042904050121601042335"
["sign"] => string(32) "2d995087a950a6fcc50b91479fecc66b"
["ordersn"] => string(23) "19042904050169684042381"
["returncode"] => string(4) "0001"
["errtext"] => string(48) "用户还款交易费率小于商户还款费率"
["orderid"] => string(25) "2019042916022300100100699"
}
 */



/**
 * 还款前
 * 19.17
 * 还款后
 * array(9) {
["transcode"] => string(3) "050"
["merchno"] => string(15) "jn2019032514062"
["dsorderid"] => string(23) "19042904120691061042339"
["sign"] => string(32) "38e75ed0b92e235876e820d5e3f12ca5"
["ordersn"] => string(23) "19042904120623782042348"
["returncode"] => string(4) "0000"
["errtext"] => string(6) "成功"
["currAccountBalance"] => float(8.62)
["frozenamount"] => float(10.55)
}
 */



/**
 * 扣款
 *
 * array(12) {
["methodname"] => string(3) "pay"
["transcode"] => string(3) "050"
["version"] => string(4) "0100"
["merchno"] => string(15) "jn2019032514062"
["ordersn"] => string(23) "19042904354005163042345"
["dsorderid"] => string(24) "P19042903363202925042333"
["subMerchantNo"] => string(12) "050387270830"
["bindId"] => string(12) "BK4544842552"
["amount"] => int(1000)
["notifyUrl"] => string(45) "http://www.juniuguanjia.com/pay/Huidiao/index"
["userFee"] => int(75)
["province"] => string(6) "410100"
}
 *
 *
 *
 * array(9) {
["transcode"] => string(3) "050"
["merchno"] => string(15) "jn2019032514062"
["dsorderid"] => string(24) "P19042903363202925042333"
["sign"] => string(32) "b8e693e27d4a840c431973abf82c653a"
["ordersn"] => string(23) "19042904362201329042372"
["returncode"] => string(4) "0003"
["errtext"] => string(15) "交易处理中"
["orderid"] => string(25) "2019042916334400100107839"
["merchantName"] => string(36) "登封市颍阳镇豪门娱乐场所"
}
 *
 *
 *
 * {sign=dafe146c3fcd204cbfc64029588062f3, message=交易成功, amount=10.00, transtype=133, merchno=jn2019032514062, status=00, signType=MD5, dsorderid=P19042903363202925042333, orderid=2019042916334400100107839, paytime=20190429163415}
 */





/**
 *
 * array(9) {
["transcode"] => string(3) "050"
["merchno"] => string(15) "jn2019032514062"
["dsorderid"] => string(24) "P19042904511292291042331"
["sign"] => string(32) "5ce48b2d1991b28ffc7417db447fd3c4"
["ordersn"] => string(23) "19042904511297704042369"
["returncode"] => string(4) "0003"
["errtext"] => string(15) "交易处理中"
["orderid"] => string(25) "2019042916483400100111650"
["merchantName"] => string(30) "郑州乐驿旅馆有限公司"
}
 *
 *
 *
 *
 *
 * array(8) {
["transcode"] => string(3) "050"
["merchno"] => string(15) "jn2019032514062"
["dsorderid"] => string(23) "19042904544849635042334"
["sign"] => string(32) "8be33b1017926157a1c26ef2013e42e4"
["ordersn"] => string(23) "19042904544873062042393"
["returncode"] => string(4) "0003"
["errtext"] => string(15) "交易处理中"
["orderid"] => string(25) "2019042916521000100112606"
}
 */